import 'package:flutter/material.dart';

import '../../../constants.dart';
import 'cast_card.dart';

class CastAndCrew extends StatelessWidget {
  final List casts;

  const CastAndCrew({Key key, this.casts}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: <Widget>[
        Padding(
          padding: EdgeInsets.all(kDefaultPadding),
                  child: Text(
            "cast & crew",
            style: Theme.of(context).textTheme.headline5,
          ),
        ),
        SizedBox(
          height: 160,
          child: ListView.builder(
            padding: EdgeInsets.only(right: kDefaultPadding),
            physics: BouncingScrollPhysics(),
            scrollDirection: Axis.horizontal,
            itemCount: casts.length,
            itemBuilder: (context, index) => CastCard(
              cast: casts[index],
            ),
          ),
        )
      ],
    );
  }
}